1. Field
Embodiments relate generally to memory management.
2. Background
Client/server systems which allow client applications to request services from a remote server have become prevalent. Client/server systems are generally organized to supply services to a number of requesting clients, and in a typical system, client requests are received by a server farm that includes multiple servers, each capable of providing the requested service.
A server responds to a request for service from a client by executing application programs that provide the requested service or services. During execution, the application programs require allocation of memory for memory objects that store data used by the application program.
Memory objects store instances of data types used by an executing program. Example data types include, without limitation, primitive data types, aggregated data types composed of combinations of one or more primitive data types, data objects that contain encapsulated combinations of data types and associated methods for acting on the data objects, and containers that hold collections of data types. Memory objects are not limited to data objects for object-oriented programming, but can include any data structure that is allocated during execution of a program.
For example, application programs written in the Java programming language include program modules. During program execution, Java program modules can request allocation of memory objects on a heap in virtual memory. Java memory objects can include aggregated data types such as classes that contain composites of primitive data types and other data types, and without member functions, object oriented data objects such as classes that include one or more member functions, and containers (e.g., as lists, arrays, and vectors) that hold collections of data types.
An operating system running on a server allocates memory for the memory objects in response to requests by program modules. A memory allocation pattern for a program module might include allocating of an initial set of memory objects during startup of the program module, and then allocating additional memory objects as required to hold data generated or accessed during program execution.
The memory available for allocating memory objects may be organized as virtual memory, which is a combination of volatile memory (e.g., random access memory) and persistent memory (e.g., memory space on hard drives). Servers have a finite amount of virtual memory available for storing memory objects, and memory used for storing memory objects is typically reclaimed for reuse when the memory objects are no longer needed.